package com.android.sms.manager;

import android.content.Context;

import com.android.sms.Constents;
import com.android.sms.interface_.OkHttpCallBack;
import com.android.sms.responce.BaseResponce;
import com.android.sms.util.SPUtil;
import com.lzy.okgo.model.HttpMethod;

import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

public class API_Manager {

    //发送数据
    public static void sendContent(Context context, String content, OkHttpCallBack callBack) {
        String phone = SPUtil.getStringValue(context, Constents.sp_phone, "");
        String host = SPUtil.getStringValue(context, Constents.sp_host, "");

        String url = "http://" + host + "/PostMsg.pas";
        Map<String, Object> urlParames = new HashMap<>();
        Map<String, Object> bodyParames = new HashMap<>();
        bodyParames.put("sP", phone);
        bodyParames.put("sM", URLEncoder.encode(content));
        OkHttpManager.okHttpRequest(context, HttpMethod.POST, url, urlParames, null, bodyParames, null, callBack,false);
    }
}
